
export function useDebouncedRef(value, delay=500){
  let timeout
  return customRef((track, trigger) => {
      return {
          get() {
              track()
              return value
          },
          set(newValue){
              clearTimeout(timeout)
              timeout = setTimeout(() => {
                  value = newValue
                  trigger()
              }, delay)
          }
      }
  })
}
